package com.heima.article.controller.v1;

import com.heima.article.service.ApArticleService;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.article.dtos.ArticleInfoDto;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/api/v1/article")
public class ArticleController {
    @Autowired
    private ApArticleService articleService;

    /**
     * app端文章保存接口
     * @param dto
     * @return
     */
    @PostMapping("/save")
    public ResponseResult saveArticle(@RequestBody ArticleDto dto){
        return articleService.saveArticle(dto);
    }


    /**
     * 回显用户行为数据
     * @param dto
     * @return
     */
    @PostMapping("/load_article_behavior")
    public ResponseResult loadArticleBehavior(@RequestBody ArticleInfoDto dto){
        return articleService.loadArticleBehavior(dto);
    }




}
